const babel = require("@babel/core");
const sourceCode = `import $ from 'jquery';`;
const result = babel.transform(sourceCode, {
    presets:[ ["@babel/preset-env",{modules:false}]]
});
console.log(result.code);
//false import $ from 'jquery';